package com.wpf.api;


import com.wpf.flux2client.bean.Person;
import com.wpf.flux2client.server.ApiServer;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@ApiServer("http://localhost:8080/person")
public interface IPersonApi {

    @GetMapping("/getAll")
    Flux<Person> getAll();

    @GetMapping("/getById/{id}")
    Mono<Person> queryPersonById(@PathVariable("id") String id);

    @DeleteMapping("/delete/{id}")
    Mono<Void> deleteById(@PathVariable("id") String id);

    @PostMapping("/save")
    Mono<Person> save(@RequestBody Mono<Person> person);

}
